using System;
using System.Linq;
using System.Diagnostics.Contracts;
using System.Collections.Generic;


namespace FoundationLib.Mail 
{
	/// <summary>
	/// Represents a code contract for mail templates.
	/// </summary>
	[ContractClassFor(typeof(IMailTemplate))]
	internal abstract class MailTemplateContract : IMailTemplate 
	{
		/// <summary>
		/// Gets or sets the mail connector to be used while processing this template.
		/// </summary>
		public IMailConnector Connector
		{
			get
			{
				return (default(IMailConnector));
			}
			set
			{
				Contract.Requires(value != null);
			}
		}

		/// <summary>
		/// Gets or sets the template content.
		/// </summary>
		public string Contents
		{
			get
			{
				return default(string);
			}
			set
			{
				Contract.Requires(!String.IsNullOrEmpty(value));
			}
		}

		/// <summary>
		/// Gets or sets the data to be used with this template.
		/// </summary>
		public MailData Data
		{
			get
			{
				return default(MailData);
			}
			set
			{
				Contract.Requires(value != null);
			}
		}

		/// <summary>
		/// Gets or sets the template parser.
		/// </summary>
		public TemplateParser Parser
		{
			get
			{
				return default(TemplateParser);
			}
			set
			{
				Contract.Requires(value != null);
			}
		}

		/// <summary>
		/// Gets a list of target email addresses.
		/// </summary>
		public IList<string> MailRecipients
		{
			get
			{
				Contract.Ensures(Contract.Result<IList<string>>() != null);
				return (default(IList<string>));
			}
		}

		/// <summary>
		/// Processes this template by replacing all template variables with the data
		/// provided and sending the mail to the given recipient.
		/// </summary>
		/// <exception cref="ArgumentNullException">A null-reference or empty list was
		/// passed.</exception>
		/// <exception cref="InvalidOperationException">This operation cannot be performed
		/// because its instance is in an invalid state.</exception>
		public void Process()
		{
		}

		/// <see cref="IDisposable.Dispose()"/>
		public void Dispose()
		{
		}

	}

}